home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Nejlepší hry
/
Nejlepsi hry.iso
/
hry
/
sea of chaos
/
sea_install.msi
/
_15C39AAA7726369D39812BD40F01CF6A
/
_0FA02DF72CF9440EAF0833CE416A9587
< prev
next >
Wrap
Text File
|
2004-11-20
|
879b
|
45 lines
//sky pixel shader:
//mixes color of 2 layers of sky
//Luke Lenhart
//(C)2004-2005 Digipen Institute of Technology
//blend factor between 2 layers
float blend;
//"extra" color to add to final color
float4 clrExtra;
//base color sampler
sampler2D sampSky1;
//cloud sampler
sampler2D sampSky2;
//shader input
struct PS_INPUT
{
float4 Color : COLOR;
float2 Tex0 : TEXCOORD0;
float2 Tex1 : TEXCOORD1;
};
//shader code
float4 PShader(PS_INPUT In) : COLOR
{
//sample textutes
float4 sky1=tex2D(sampSky1,In.Tex0);
float4 sky2=tex2D(sampSky2,In.Tex1);
//base color is blend of the 2 laters
float4 clr=lerp(sky1,sky2,blend);
//alpha is modulus of both blended with base
clr.a=lerp(sky1.a*0.5f, sky2.a, blend*blend);
//blend with vert color
clr*=In.Color + clrExtra*In.Color.a;
//spit out color
return clr;
}